﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Master/DefaultNonMenu.master" AutoEventWireup="true" CodeBehind="OrderAddr.aspx.cs" Inherits="Runda.EShop.Web.Customer.OrderAddr" %>

<%@ Register Assembly="Runda.EShop.Common.Component" Namespace="Runda.EShop.Common.Component" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cphHeader" runat="server">
<script src="../Content/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
<script type="text/javascript">
    $(function () {

        $('#cphMain_cphMain_gvList input[type=radio]').click(function () {
            $.each($('#cphMain_cphMain_gvList input[type="radio"]'), function () { this.checked = false; });
            this.checked = true;
        })

    })

    function Check() {
        var flag = false; var id = '';
        $('#cphMain_cphMain_gvList input[type="radio"]').each(function () {

            if ($(this).attr('checked') != undefined && $(this).attr('checked')=='checked') {
                flag = true;
                id = $(this).attr('id');
            }
        });

        if (flag) {
            return true;
        }
        else {
            alert('请选择地址');
            return false;
        }
    }

    function CheckAddress() {
        if ($('#<%=txtName.ClientID %>').val() == '') {
            alert('请输入收货人姓名');
            return false;
        }

        if ($('#<%=txtPhone.ClientID %>').val() == '') {
            alert('请输入收货人电话');
            return false;
        }

        if ($('#<%=txtAddress.ClientID %>').val() == '') {
            alert('请输入送货地址');
            return false;
        }
    }
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cphMain" runat="server">
<div class="i_tablebt_xian" style="margin:10px 0px 0px 0px; width:100%;">
        <span class="l"><img alt="" src="<%=ResolveUrl("~/images/ico/down_16x16.gif")%>" align="absmiddle" />订单基本信息</span>
</div>
<table   border="0" cellspacing="2" cellpadding="10" width="100%" class="l i_center_table1 margin-top18 ">  
     <tr>
	   <td align="center" style="width:10%;">订单类型</td>
       <td align="left"  style="width:30%;">
            <asp:RadioButtonList ID="rblOrderType" runat="server" RepeatColumns="2" Width="200px">
            <asp:ListItem Text="正常订单" Value="1" Selected="True" />
            <asp:ListItem Text="预订单" Value="0" />
            </asp:RadioButtonList>
       </td>
       <td style="width:10%;">期望到货日期</td>
       <td style="width:50%;"><asp:TextBox ID="txtHopeDate" runat="server" Width="100px" CssClass="Wdate"></asp:TextBox></td> 
       </tr><tr>  
       <td align="left" colspan="4">备注（其他特殊要求请在此处填写，限200字以内。）</td>
       </tr><tr>
       <td align="left" colspan="4"><asp:TextBox ID="txtMemo" runat="server" TextMode="MultiLine" Height="30px" Width="100%" MaxLength="200"></asp:TextBox></td>
       
     </tr>     
</table>

<div class="i_tablebt_xian" style="margin:10px 0px 0px 0px; width:100%;">
        <span class="l"><img alt="" src="<%=ResolveUrl("~/images/ico/down_16x16.gif")%>" align="absmiddle" />送货地址选择</span>
</div>
    <asp:GridView ID="gvList" runat="server" AutoGenerateColumns="False" DataKeyNames="ID" onrowdatabound="gvList_RowDataBound">
        <Columns>
           <asp:TemplateField HeaderText="操作">
                <ItemTemplate>
                    <asp:RadioButton ID="rbSelect" runat="server" />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="Name" HeaderText="收货人" />
            <asp:BoundField DataField="Phone" HeaderText="收货人电话" />
            <asp:BoundField DataField="Address" HeaderText="详细地址" />
            <asp:BoundField DataField="PostCode" HeaderText="邮编" />
        </Columns>
    </asp:GridView>

 <div class="banner7 r">
        <asp:LinkButton ID="btnSave" runat="server" onclick="btnSave_Click" OnClientClick="return Check()">提交订单</asp:LinkButton>
</div> 

<div class="i_tablebt_xian" style="margin:10px 0px 0px 0px; width:100%;">
        <span class="l"><img alt="" src="<%=ResolveUrl("~/images/ico/down_16x16.gif")%>" align="absmiddle" />添加临时送货地址</span>
</div>
 <table cellspacing="3px" cellpadding="3px" width="100%" class="i_center_table11">
        <tr>
            <td>
                收货人姓名</td>
            <td>
                <asp:TextBox ID="txtName" runat="server"></asp:TextBox>
            </td>
            <td>
                收货人电话</td>
            <td>
                <asp:TextBox ID="txtPhone" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td>
                详细收货地址
            </td>
            <td>
                <asp:TextBox ID="txtAddress" runat="server" Width="250px"></asp:TextBox>
            </td>
            <td>
                 邮编
            </td>
            <td>
                <asp:TextBox ID="txtPostCode" runat="server" MaxLength="10"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
            <td>
             <div class="banner l">
                 <asp:LinkButton ID="lnkbtnAdd" runat="server" onclick="lnkbtnAdd_Click" OnClientClick="return CheckAddress();">保存地址</asp:LinkButton>
                 </div>
            </td>
        </tr>
</table>
</asp:Content>
